package edu.core.testapp.server;

import protect01.Dict;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

import edu.core.testapp.client.Protect01Service;

@SuppressWarnings("serial")
public class Protect01ServiceImpl extends RemoteServiceServlet implements
		Protect01Service {

	final String al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	
	@Override
	public String getDict(String keyWord, Integer num) {
        char[] alfa = al.toCharArray();
		return (new Dict(alfa, keyWord, num)).toString();
	}

	@Override
	public String decodeString(String string, String keyWord, Integer num) {
		char[] alfa = al.toCharArray();
		Dict d = new Dict(alfa, keyWord, num);
		return d.decodeString(string);
	}

	@Override
	public String encodeString(String string, String keyWord, Integer num) {
		char[] alfa = al.toCharArray();
		Dict d = new Dict(alfa, keyWord, num);
		return d.encodeString(string);
	}

}
